program Rate
implicit none

character(len=79)INPUTfile,arg,ARGUMENT
integer N,nargs,ios,i
real k,data(200)

 nargs = iargc()
 if(nargs/=2)then
  write(*,*)"$0 NumberOfDATA Input"
  write(*,*)"./rate.x NumB bindingInput.dat"
 goto 1000
 else
  call getarg(1,arg)
   read(arg,*) N
  call getarg(2,arg)
    INPUTfile=arg
 endif

i=0
k=0.0
open(10,file=INPUTfile,status="old")
readlist: do
	read(10,"(A)",iostat=ios)ARGUMENT
	if(ios/=0)exit readlist
	i=i+1
	read(ARGUMENT,*) data(i)
	k=k+log(1000000000.0/data(i))
enddo readlist

  write(*,*) N,i,k/i
1000 end program
